#ifndef OFFICEDOCMENT_H
#define OFFICEDOCMENT_H


#include"HtmlElement.h"


class HtmlElement;
class QFile;
class QFileInfo;
class  OfficeDocment : public QObject
{
    Q_OBJECT
public:
    enum DomType{undefine=0,doc,xls,pdf};
    OfficeDocment( QObject* parent = nullptr,QFile *fileName =nullptr );
    explicit OfficeDocment(QString fileName ,QObject* parent = nullptr);
    ~OfficeDocment();
    /**
     * @brief creactEle 创建一个元素 并返回其指针
     * @param type
     * @return
     */
    HtmlElement *creactEle(EleFactory::EleType type);

    bool printToFile(DomType type);

    void appendElement(HtmlElement *ele);


    QFile *getFilePath() const;
    void setFilePath(QFile *value);

private:
    QFile * m_pFile;
    QString m_sFileName;
    QFileInfo *m_pfileInfo;
    QList<HtmlElement*> eleLsit;
    EleFactory eleFactory;
};

#endif // OFFICEDOCMENT_H
